var group1 = document.getElementById("group1");
var btn_group1 = document.getElementById("btn_group1");

function showHiddenGroup1() {
	if (group1.style.display == "none") {
		group1.style.display = "block";
		btn_group1.innerText = "点击收起";
	} else {
		group1.style.display = "none";
		btn_group1.innerText = "点击展开";
	}
}

var group2 = document.getElementById("group2");
var btn_group2 = document.getElementById("btn_group2");
var ul_group2 = document.getElementById("ul_group2");

// 遍历数组1
var otherParts = ['财务部', '行政部', '采购部', '商务部'];
for (let index in otherParts) {
	let li = document.createElement('li')
	li.textContent = otherParts[index];
	ul_group2.appendChild(li);
}

// 遍历数组2
// otherParts.forEach((part) =>{
// 	let li = document.createElement('li')
// 	li.textContent = part;
// 	ul_group2.appendChild(li);
// })

function showHiddenGroup2() {
	if (group2.style.display == "none") {
		group2.style.display = "block";
		btn_group2.innerText = "点击收起";
	} else {
		group2.style.display = "none";
		btn_group2.innerText = "点击展开";
	}
}